package models

import "time"

type PolicyAction int64

const (
	ActionBlock       PolicyAction = 100 //如果是CC攻击直接封禁IP 2个小时
	ActionCAPTCHA     PolicyAction = 200 //如果疑似CC攻击则需要人机验证
	ActionObservePass PolicyAction = 400 //不确定的攻击，记录下来观察
)

type ClientStat struct {
	Count         int64
	IsBlackIP     bool
	RemainSeconds time.Duration
}

type CCLog struct {
	ID          int64        `json:"id"`
	RequestTime int64        `json:"request_time"`
	ClientIP    string       `json:"client_ip"`
	Host        string       `json:"host"`
	Method      string       `json:"method"`
	UrlPath     string       `json:"url_path"`
	UrlQuery    string       `json:"url_query"`
	ContentType string       `json:"content_type"`
	UserAgent   string       `json:"user_agent"`
	Cookies     string       `json:"cookies"`
	RawRequest  string       `json:"raw_request"`
	Action      PolicyAction `json:"action"`
	DomainName  string       `json:"domain_name"`
}
